//烧水  切菜

function dianWater(){
    return new Promise((resolve,reject) => {
        setTimeout(() => {
            resolve('电烧水成功');//
        },500)
    })
}

function meiWater(){
    return new Promise((resolve,reject) => {
        setTimeout(() => {
            resolve('煤气烧水成功');//
        },1000)
    })
}

function cut(){
    return new Promise((resolve,reject) => {
        setTimeout(() => {
            resolve('切菜完毕');//
        },2000)
    })
}

// Promise.all([water(),cut()]).then(res => {
//     console.log(res);//[ '烧水完毕', '切菜完毕' ]
// }).catch(error=>{
//     console.log(error)
// })

Promise.race([dianWater(),meiWater()]).then(res => {
    console.log(res);
})